<div class="{{$viewClass['form-group']}}">

    <div  class="{{ $viewClass['label'] }} control-label">
        <span>{!! $label !!}</span>
    </div>

    <div class="{{$viewClass['field']}} d-flex">

        @include('admin::form.error')
        <div class="col-md-6" style="padding-right:0px">
        <input type="hidden" name="{{$name}}"/>

        <select class="form-control {{$class}}" style="width: 100%;" name="{{$name}}" {!! $attributes !!} >
            <option value=""></option>
            @if($groups)
                @foreach($groups as $group)
                    <optgroup label="{{ $group['label'] }}">
                        @foreach($group['options'] as $select => $option)
                            <option value="{{$select}}" {{ $select == $value ?'selected':'' }}>{{$option}}</option>
                        @endforeach
                    </optgroup>
                @endforeach
             @else
                @foreach($options as $select => $option)
                    <option value="{{$select}}" {{ Dcat\Admin\Support\Helper::equal($select, $value1) ?'selected':'' }}>{{$option}}</option>
                @endforeach
            @endif
        </select>
        </div>
        <div class="col-md-1" style="font-size: 26px;font-weight: 700; text-align: center;line-height: 23px;">.</div>
        <div class="col-md-6" style="padding-left:0px">
        <select class="form-control {{$class}}" name="{{$name}}_1_1" id="{{$name}}_1">
            <option value=""></option>
            @foreach($options1 as $select => $option)
                <option value="{{$select}}" {{$select == $value2 ?'selected':'' }}>{{$option}}</option>
            @endforeach
        </select>
        <input type="hidden" name="{{$name}}_1" value="{{ $value2 }}"/>
        </div>

        @include('admin::form.help-block')

    </div>
</div>

@include('admin::form.select-script')

<script>
$(function() {
    $("#{{$name}}_1").select2({"tags":true,"allowClear":true});
    $("select[name={{$name}}]").on('select2:select', function () {
        $('#{{$name}}_1').select2("open");
    });
    $("select[name={{$name}}_1_1]").on('select2:select', function (e) {
        var data = e.params.data;
        $('input[name={{ $name  }}_1]').val(data.text)
    });
});
</script>